package com.hongdee.crm.visit.controller;

import com.hongdee.crm.average.service.ITCrmAverageAccidentService;
import com.hongdee.crm.visit.service.ITCrmVisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by dell on 2017/6/14.
 */
@RestController
@RequestMapping("/crm/visit")
public class visitController {
    @Autowired
    private ITCrmVisitService itCrmVisitService;

    @RequestMapping("/page")
    @ResponseBody
    public Map newPage(@RequestParam(name = "uid", defaultValue = "") String uid,
                       @RequestParam(name = "token", defaultValue = "") String token,
                       @RequestParam(name = "start", defaultValue = "0") String start,
                       @RequestParam(name = "limit", defaultValue = "50") String limit,
                       @RequestBody Map date) throws Exception {
        Map map = this.itCrmVisitService.newPage(start, limit,date);
        map.put("success", true);
        map.put("msg", "分页查询成功！");
        return map;
    }
}
